%h1 Listing common templates

= link_to 'New Common template', new_common_template_path,
      class: 'btn btn-primary pull-right new-ctemplate-btn'
= paginate @common_templates, theme: 'twitter-bootstrap-3'

%table{class: 'table'}
  %thead
    %tr
      %th Image
      %th Name
      %th Status
      %th Approved at
      %th Rejected at
      %th Category
      %th Notes
      %th
      %th
      %th

  %tbody
    - @common_templates.each do |common_template|
      %tr
        %td{class: 'template-icon'}
          = image_tag common_template.icon.url(:small)
        %td= common_template.name
        %td= common_template.status
        %td= common_template.approved_at
        %td= common_template.rejected_at
        %td= common_template.category_name
        %td= common_template.notes
        %td{class: 'col-md-1'}
          = link_to 'Show', common_template, class: 'btn btn-default'
        %td{class: 'col-md-1'}
          = link_to 'Edit', edit_common_template_path(common_template), class: 'btn btn-warning template-form-link'
        %td{class: 'col-md-1'}
          = link_to 'Destroy', common_template, :method => :delete, :data => { :confirm => 'Are you sure?' }, class: 'btn btn-danger'

%br
= paginate @common_templates, theme: 'twitter-bootstrap-3'
